// eslint-disable-next-line no-unused-vars
import React from 'react'

export default {
    // 时间格式化
    formateDate(time) {
        if (!time) return '';
        let date = new Date(time);
        let seperator1 = "-";
        let year = date.getFullYear();
        let month = date.getMonth() + 1;
        let strDate = date.getDate();
        let seperator2 = ":";
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        let currentdate = year + seperator1 + month + seperator1 + strDate
            + " " + date.getHours() + seperator2 + date.getMinutes() + seperator2 + date.getSeconds();

        return currentdate;
    },
}